#ifndef CONTROL_POINT_H
#define CONTROL_POINT_H

#include <pthread.h>
#include <upnp.h>

#include "DeviceList.h"

class ControlPoint {
public:
	ControlPoint();
	virtual ~ControlPoint();

	int start();
	int stop();
	int refresh();
	void *timerLoop(void);
	static void *timerLoopProxy(void *clientd) 
	{
		static_cast<ControlPoint *>(clientd)->timerLoop();
	}
	int callbackEventHandler(Upnp_EventType eventType, void *event, void *clientd);
	static int callbackEventHandlerProxy(Upnp_EventType eventType, void *event, void *clientd) 
	{
		return static_cast<ControlPoint *>(clientd)->callbackEventHandler(eventType, event, clientd);
	}
protected:

private:
	DeviceList *devices;
	int controlHandle;
	pthread_t timerThread;
};
#endif
